🛡️ Sentinel: Fix SSRF bypass and add DoS protection to URL capture#40
🛡️ Sentinel: Fix SSRF bypass and add DoS protection to URL capture#40Sumit-5002 wants to merge 1 commit into
Conversation
- Implemented `redirect: 'manual'` in `/html-to-image` to prevent SSRF bypasses via redirects. - Added a 5-second timeout using `AbortSignal.timeout` for all fetches. - Enforced a 512KB size limit on fetched HTML content to prevent DoS. - Expanded the internal IP blacklist to include CGNAT (RFC 6598), Link-local (RFC 3927), and Benchmarking (RFC 2544) ranges. - Fixed and enhanced `server/routes/image.test.js` to correctly verify SSRF and DoS protections using DNS mocking. - Updated `.jules/sentinel.md` with new security learnings.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This PR addresses a significant security regression in the
/api/image/html-to-imageendpoint. It robustly implements SSRF protection by:Hostheader.Additionally, it adds DoS protection by enforcing a 5-second timeout and a 512KB content size limit on the fetched HTML. The associated test suite has been fixed, modernized with DNS mocking, and expanded to cover these new security controls.
PR created automatically by Jules for task 17698926566135819095 started by @Sumit-5002